<?php
namespace App\Modules\Agent;

use App\Modules\AdapterApi;
use App\Services\Agent\AgentIndex;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2018/6/12
 * Time: 10:10
 */
class Agent extends AdapterApi
{
    //添加广告位
    public function addAgent()
    {
        $data = $this->postData;
        return AgentIndex::Agent()->addAgent($data);
    }

    //代理列表
    public function agentList(){
        //$data = pick_array($this->postData, ['name', 'description']);
        $data = $this->postData;
        return AgentIndex::Agent()->agentList($data);
    }

    /**
     * 获取代理列表(不分页)
     */
    public function agentListNoPage ()
    {
        $data = $this->postData;
        return AgentIndex::Agent()->agentListNoPage($data);
    }

    //代理详情
    public function agentDetail(){
        //$data = pick_array($this->postData, ['name', 'description']);
        $data = $this->postData;
        return AgentIndex::Agent()->agentDetail($data);
    }

    //修改代理
    public function updateAgent(){
        //$data = pick_array($this->postData, ['name', 'description']);
        $data = $this->postData;
        return AgentIndex::Agent()->updateAgent($data);
    }

    //根据agent_id查看用户信息
    public function userByAgentId(){
        //$data = pick_array($this->postData, ['name', 'description']);
        $data = $this->postData;
        return AgentIndex::Agent()->userByAgentId($data);
    }

    //处理违约
    public function deal(){
        $data = $this->postData;
        return AgentIndex::Agent()->deal($data);
    }

    //注销处理
    public function cancle(){
        $data = $this->postData;
        return AgentIndex::Agent()->cancle($data);
    }

    //更新协议
    public function updateProtocol(){
        $data = $this->postData;
        return AgentIndex::Agent()->updateProtocol($data);
    }
}